package org.karelun.gef.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.karelun.gef.helper.ConstantMessages;
import org.karelun.gef.helper.IDConstant;

public class ShowPropertyAction extends Action{
	
	public static final String id="org.karelun.gef.showPropertyAction"; //$NON-NLS-1$
	
	public IWorkbenchWindow window;
	
	public ShowPropertyAction(IWorkbenchWindow window){
		this.window=window;
		setId(id);
		setText(ConstantMessages.showPropertyView);
	}

	public void run() {
		IWorkbenchPage activePage = window.getActivePage();
		try {
			activePage.showView(IDConstant.propertiesId);
		} catch (PartInitException e) {
			e.printStackTrace();
		}
	}
}
